﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="detail.aspx.vb" Inherits="customtech.detail" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1>
        Build Details</h1>
    <br />
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
        CssClass="detailpage" DataSourceID="SqlDataSource4" Height="50px" 
        Width="125px">

        <FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
        <Fields>
            <asp:ImageField DataImageUrlField="BuildPicture" HeaderText="Build Image">
                <ControlStyle CssClass="detailPicture" />
                
            </asp:ImageField>
            <asp:BoundField DataField="BuildName" HeaderText="BuildName" 
                SortExpression="BuildName">
            </asp:BoundField>
            <asp:HyperLinkField DataNavigateUrlFields="CPU" 
                DataNavigateUrlFormatString="https://www.google.co.uk/search?hl=en&amp;tbm=shop&amp;q={0}" 
                DataTextField="CPU" HeaderText="CPU" />
            <asp:HyperLinkField DataNavigateUrlFields="Motherboard" 
                DataNavigateUrlFormatString="https://www.google.co.uk/search?hl=en&amp;tbm=shop&amp;q={0}" 
                DataTextField="Motherboard" HeaderText="Motherboard" />
            <asp:BoundField DataField="RAM" HeaderText="RAM" SortExpression="RAM" />
            <asp:HyperLinkField DataNavigateUrlFields="Graphics" 
                DataNavigateUrlFormatString="https://www.google.co.uk/search?hl=en&amp;tbm=shop&amp;q={0}" 
                DataTextField="Graphics" HeaderText="Graphics" />
            <asp:BoundField DataField="HardDrive" HeaderText="HardDrive" 
                SortExpression="HardDrive" />
            <asp:BoundField DataField="Power" HeaderText="Power" SortExpression="Power" />
            <asp:HyperLinkField DataNavigateUrlFields="Casing" 
                DataNavigateUrlFormatString="https://www.google.co.uk/search?hl=en&amp;tbm=shop&amp;q={0}" 
                DataTextField="Casing" HeaderText="Casing" />
            <asp:HyperLinkField DataNavigateUrlFields="Audio" 
                DataNavigateUrlFormatString="https://www.google.co.uk/search?hl=en&amp;tbm=shop&amp;q={0}" 
                DataTextField="Audio" HeaderText="Audio" />
            <asp:HyperLinkField DataNavigateUrlFields="Mouse" 
                DataNavigateUrlFormatString="https://www.google.co.uk/search?hl=en&amp;tbm=shop&amp;q={0}" 
                DataTextField="Mouse" HeaderText="Mouse" />
            <asp:HyperLinkField DataNavigateUrlFields="Keyboard" 
                DataNavigateUrlFormatString="https://www.google.co.uk/search?hl=en&amp;tbm=shop&amp;q={0}" 
                DataTextField="Keyboard" HeaderText="Keyboard" />
            <asp:HyperLinkField DataNavigateUrlFields="Monitor" 
                DataNavigateUrlFormatString="https://www.google.co.uk/search?hl=en&amp;tbm=shop&amp;q={0}" 
                DataTextField="Monitor" HeaderText="Monitor" />
            <asp:BoundField DataField="TotalCostToBuild" HeaderText="TotalCostToBuild" 
                SortExpression="TotalCostToBuild" />
            <asp:HyperLinkField DataNavigateUrlFields="UserName" 
                DataNavigateUrlFormatString="userProfile.aspx?UserName={0}" 
                DataTextField="UserName" HeaderText="Added By" />
            <asp:BoundField DataField="DateAdded" HeaderText="Date Added" 
                SortExpression="DateAdded" />
            <asp:BoundField DataField="Description" HeaderText="Description" />
            <asp:BoundField DataField="CountOfID" HeaderText="Likes" />
            <asp:BoundField DataField="AverageRating" HeaderText="Rating" />
        </Fields>
    </asp:DetailsView>
    <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
        ConnectionString="<%$ ConnectionStrings:connstr %>" 
        ProviderName="<%$ ConnectionStrings:connstr.ProviderName %>" 
        SelectCommand="SELECT [ID], [BuildPicture], [BuildName], [TotalCostToBuild], [UserName], [AverageRating], [CountOfID], [DateAdded], [Description], [CPU], [Motherboard], [Graphics], [RAM], [HardDrive], [Casing], [Power], [Audio], [Mouse], [Keyboard], [Monitor] FROM [Builds Query1] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <div class="comment">
    <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource2">
    <HeaderTemplate>
                <p> <h3>Comments</h3> </p>
        </HeaderTemplate>
        <ItemTemplate>
                <hr />
                <p style="width: 100%; text-align: left;"><%# Container.DataItem("Comment")%></p>
                <p style="width: 100%; text-align: right;"><a href='userProfile.aspx?UserName=<%# Eval("UserName") %>'><%# Container.DataItem("userName")%></a> on <%# Container.DataItem("DateAdded")%> </p>
        </ItemTemplate>
        <FooterTemplate>
                <hr />
        </FooterTemplate>
    </asp:Repeater>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:connstr %>" 
        ProviderName="<%$ ConnectionStrings:connstr.ProviderName %>" 
        SelectCommand="SELECT Comments.Title, Comments.Comment, Comments.DateAdded, aspnet_Users.UserName, Comments.Build_fkid FROM aspnet_Users INNER JOIN Comments ON aspnet_Users.UserId = Comments.userName_fkid WHERE ([Build_fkid] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="Build_fkid" QueryStringField="ID" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    </div>
    <br />
    <br />
    <br />
   <!-- Title:
    <asp:TextBox ID="tb_title" runat="server"></asp:TextBox> -->
    <br />
    Type your comments here...<asp:TextBox ID="tb_comment" runat="server" Height="140px" 
        TextMode="MultiLine" Width="725px"></asp:TextBox>
    <br />
    <br />
    <asp:Button ID="btn_submit" runat="server" Height="38px" Text="Submit" 
        Width="134px" />
    <br />
    <br />
    <asp:CheckBoxList ID="cbl_tags" runat="server" DataSourceID="SqlDataSource3" 
        DataTextField="TagName" DataValueField="ID" RepeatDirection="Horizontal">
    </asp:CheckBoxList>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:connstr %>" 
        ProviderName="<%$ ConnectionStrings:connstr.ProviderName %>" 
        SelectCommand="SELECT [ID], [TagName] FROM [Tags]"></asp:SqlDataSource>
    <asp:Button ID="btn_tag" runat="server" Height="29px" Text="Tag" Width="63px" />
    <br />
    <br />
    <asp:TextBox ID="tb_newtag" runat="server"></asp:TextBox>
    <asp:Button ID="btn_newtag" runat="server" Text="Add Tag" />
    <br />
    <br />
    <br />
    <br />
    <asp:Rating ID="Rating1" runat="server" CurrentRating="0" 
        EmptyStarCssClass="emptyrating" FilledStarCssClass="donerating" 
        StarCssClass="donerating" WaitingStarCssClass="waitingrating">
    </asp:Rating>
&nbsp;<br />
    <br />
    <br />
    <asp:Button ID="btn_rate" runat="server" Height="37px" Text="Rate" 
        Width="122px" ClientIDMode="Static" />
    <br />
    <br />
    <br />
    <br />
    <asp:Button ID="btn_like" runat="server" Height="30px" Text="Like" 
        Width="68px" />
    <asp:Image ID="img_like" runat="server" ImageUrl="~/Pictures/like.png" />
    <br />
    <br />
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <br />
    <br />
</asp:Content>
